/**  
 * All rights Reserved, Designed By www.flksh.com
 * @date:   2017-10-31 14:24:09   
 * @Copyright: 2013-2017 www.flksh.com Inc. All rights reserved. 
 * 注意：本内容仅限于上海福乐康社区养老服务有限公司内部传阅，禁止外泄以及用于其他的商业目
 */
package com.zx.cloud.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zx.cloud.ApiVersion;
import com.zx.cloud.RequestLogging;
import com.zx.cloud.common.filter.CurrentUserId;
import com.zx.cloud.domain.ClientContact;
import com.zx.cloud.model.response.ObjectDataResponse;
import com.zx.cloud.model.response.Response;
import com.zx.cloud.service.ClientContactService;

import io.swagger.annotations.ApiOperation;


/**
 * 
 */
@RestController
@RequestMapping(value = ApiVersion.PROVIDER_V1_PREFIX+"/clientContact")
public class ClientContactController{
	
	@Autowired
	private ClientContactService clientContactService;
	
	@RequestLogging
	@ApiOperation(value = "修改会员联系人信息" , notes = "修改会员联系人信息")
	@RequestMapping(value = "/updateClientContact", method = RequestMethod.POST)
	@ResponseBody
	public Response updateClientContact(@CurrentUserId Long userId,HttpServletRequest request,@RequestBody  ClientContact clientContact){
		clientContact.setClientId(userId);
		int success = clientContactService.update(clientContact);
		return new ObjectDataResponse<Integer>(success);
	}
	
	@RequestLogging
	@ApiOperation(value = "添加会员联系人信息" , notes = "添加会员联系人信息")
	@RequestMapping(value = "/addclientContact", method = RequestMethod.POST)
	@ResponseBody
	public Response addclientContact(@CurrentUserId Long userId,HttpServletRequest request,@RequestBody  ClientContact clientContact){
		int success = clientContactService.insert(clientContact);
		return new ObjectDataResponse<Integer>(success);
	}
	
}
